<?php

include_once($cfgPaths['lib'].'cms/type/cmsEditType.o.inc.php');

class cmsEditDownloadType extends cmsEditType {

 function registerFields () {
   $map[] = $this->name.'href';
   $map[] = $this->name.'target';
   $map[] = $this->name.'description';
   $this->map = &$map;
 }

 function render_html () {
  global $dba,$env;
  $html  = '<div class="xicstypeplugin">'."\n";
  $html .= '    <h3>'.$this->descr.':</h3>'.$this->showFields()."\n";
  $html .= '  <table border="0">'."\n";
  $html .= '     <tr>'."\n";
  $html .= '      <td width="100">HREF:</td>'."\n";
  $html .= '      <td>'."\n";
  $html .= '        <input tabindex="'.$this->sender->getNextTabindex($this->name.'href').'" name="'.$this->name.'href" value="'.htmlspecialchars($this->getValue($this->name.'href')).'" size="50" maxlength="255"> <a style="vertical-align:top" href="javascript:;" onClick="top.showModal(\'Download ausw&auml;hlen\', \'pics/OpenDialogFrame.php?referer='.$this->name.'href&caller=download&mode=href\', window, 500, 400, true);"><img src="' . 
  base_ApplicationContext::getInstance()->mediaPath()->main() . 'cms/folder_go.png" border="0"></a><td>'."\n";
  $html .= '     </tr>'."\n";
  $html .= '     <tr>'."\n";
  $html .= '      <td>Target:</td>'."\n";
  $html .= '      <td>'."\n";
  $html .= '        <select tabindex="'.$this->sender->getNextTabindex($this->name.'target').'" name="'.$this->name.'target">'."\n";
  $html .= '          <option value="_self">_self</option>'."\n";
  $html .= '          <option value="_blank">_blank</option>'."\n";
  $html .= '          <option value="_parent">_parent</option>'."\n";
  $html .= '          <option value="_top">_top</option>'."\n";
  $frames = $dba->getFramesBySite($env->getSession('s_currentSite'));
  for ($i=0;$i<count($frames);$i++) 
  {
       $html .= '          <option value="'.$frames[$i]['name'].'">'.$frames[$i]['name'].'</option>'."\n";
  }
  $html .= '        </select>';
  $html .= '<td>'."\n";
  $html .= '     </tr>'."\n";
  $html .= '     <tr>'."\n";
  $html .= '      <td>Text:</td>'."\n";
  $html .= '      <td>'."\n";
  $html .= '        <input tabindex="'.$this->sender->getNextTabindex($this->name.'description').'" name="'.$this->name.'description" value="'.htmlspecialchars($this->getValue($this->name.'description')).'" size="50" maxlength="255"></td>'."\n";
  $html .= '     </tr>'."\n";
  $html .= '  </table>'."\n";
  $html  .= '</div><!-- / type download -->'."\n";
  return $html;
 }

 function render_javascript () {
 }

}


?>